package com.hengpeng.itfin.service;

import java.util.Date;

import com.hengpeng.common.exception.ServiceResult;
import com.hengpeng.itfinbase.message.partner.CashRequestMsg;
import com.hengpeng.itfinbase.message.partner.CashResponseMsg;
import com.hengpeng.itfinbase.message.partner.DrawReconciliationResponseMsg;
import com.hengpeng.itfinbase.message.partner.PayRequestMsg;
import com.hengpeng.itfinbase.message.partner.PayResponseMsg;
import com.hengpeng.itfinbase.message.partner.SaveReconciliationResponseMsg;
import com.hengpeng.itfinbase.persist.Payment;

/**
 * <pre>
 *  支付系统服务接口
 * </pre>
 * @author zhaojitao
 * @version 1.0, 2015-6-4
 */
public interface PaymentService
{

	/**
	 * <pre>
	 * 包装充值请求实体（保存本地充值信息）
	 * </pre>
	 */
	public void packPayRequest(PayRequestMsg request);

	/**
	 * <pre>
	 * 处理支付结果
	 * </pre>
	 * @param msg
	 * @return
	 */
	public ServiceResult<Payment> dealPayResult(PayResponseMsg msg);

	/**
	 * <pre>
	 * 包装取现请求实体（保存本地取现信息）
	 * </pre>
	 */
	public void packDrawRequest(CashRequestMsg request);

	/**
	 * <pre>
	 * 处理支付结果
	 * </pre>
	 * @param msg
	 * @return
	 */
	public ServiceResult<Payment> dealDrawResult(CashResponseMsg msg);

	/**
	 * <pre>
	 * 根据orderId查找充值记录
	 * </pre>
	 * @param orderId
	 * @return
	 */
	public Payment findByOrderId(String orderId);
	
	/**
	 * <pre>
	 * 根据orderId和ProviderId查找充值记录
	 * </pre>
	 * @param orderId
	 * @return
	 */
	public Payment findByOrderIdAndProviderId(String orderId,String providerId);
	
	/**
	 * <pre>
	 * 充值对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 */
	public void saveReconciliation(Integer pageNum, Integer pageSize,Date beginDate, Date endDate);
	
	/**
	 * <pre>
	 * 充值对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	public SaveReconciliationResponseMsg doSaveReconciliation (Integer pageNum, Integer pageSize, Date beginDate, Date endDate);
	
	/**
	 * <pre>
	 * 提现对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 */
	public void drawReconciliation(Integer pageNum, Integer pageSize,Date beginDate, Date endDate);
	
	/**
	 * <pre>
	 * 提现对账
	 * </pre>
	 * @param pageNum
	 * @param pageSize
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	public DrawReconciliationResponseMsg doDrawReconciliation (Integer pageNum, Integer pageSize, Date beginDate, Date endDate);
}